/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.workflow.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.hera.base.domain.BaseDomain;

/**
 *
 * @author cmontes
 */
@Entity
@Table(name = "TASK_INSTANCE_CACHE")
public class TaskInstanceCache extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "ID_PROCESS_INSTANCE")
    private Long idProcessInstance;
    @Column(name = "ID_PROCESS")
    private Long idProcess;
    @Column(name = "TASK_NAME")
    private String taskName;
    @Column(name = "MAX_END_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date maxEndDate;
    @Column(name = "REQUESTED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date requestedDate;
    @Column(name = "RESPONSE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date responseDate;
    @Column(name = "CURRENT_USER1")
    private Long currentUser1;
    @Column(name = "CUSTOM_CODE")
    private String customCode;
    @Column(name = "ID_STATUS")
    private Long idStatus;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_TASK")
    private Long idTask;
    @Column(name = "PROCESS_NAME")
    private String processName;
    @Column(name = "ID_STAGE")
    private Long idStage;
    @Column(name = "ID_EXT_REFERENCE")
    private Long idExtReference;

    public TaskInstanceCache() {
    }

    public TaskInstanceCache(Long idTask) {
        this.idTask = idTask;
    }

    public Long getIdProcessInstance() {
        return idProcessInstance;
    }

    public void setIdProcessInstance(Long idProcessInstance) {
        this.idProcessInstance = idProcessInstance;
    }

    public Long getIdProcess() {
        return idProcess;
    }

    public void setIdProcess(Long idProcess) {
        this.idProcess = idProcess;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public Date getMaxEndDate() {
        return maxEndDate;
    }

    public void setMaxEndDate(Date maxEndDate) {
        this.maxEndDate = maxEndDate;
    }

    public Date getRequestedDate() {
        return requestedDate;
    }

    public void setRequestedDate(Date requestedDate) {
        this.requestedDate = requestedDate;
    }

    public Date getResponseDate() {
        return responseDate;
    }

    public void setResponseDate(Date responseDate) {
        this.responseDate = responseDate;
    }

    public Long getCurrentUser1() {
        return currentUser1;
    }

    public void setCurrentUser1(Long currentUser1) {
        this.currentUser1 = currentUser1;
    }

    public String getCustomCode() {
        return customCode;
    }

    public void setCustomCode(String customCode) {
        this.customCode = customCode;
    }

    public Long getIdStatus() {
        return idStatus;
    }

    public void setIdStatus(Long idStatus) {
        this.idStatus = idStatus;
    }

    public Long getIdTask() {
        return idTask;
    }

    public void setIdTask(Long idTask) {
        this.idTask = idTask;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public Long getIdStage() {
        return idStage;
    }

    public void setIdStage(Long idStage) {
        this.idStage = idStage;
    }

    public Long getIdExtReference() {
		return idExtReference;
	}

	public void setIdExtReference(Long idExtReference) {
		this.idExtReference = idExtReference;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (idTask != null ? idTask.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof TaskInstanceCache)) {
            return false;
        }
        TaskInstanceCache other = (TaskInstanceCache) object;
        if ((this.idTask == null && other.idTask != null) || (this.idTask != null && !this.idTask.equals(other.idTask))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.TaskInstanceCache[ idTask=" + idTask + " ]";
    }
    
}
